package com.example.demo3.c6;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
@WebServlet("/req")
public class RegisterServlet65 extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//        response.setContenttype("text/html");
        response.setContentType("text/html");
        response.setCharacterEncoding("UTF-8");
        request.setCharacterEncoding("UTF-8");
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        String email = request.getParameter("email");
        String sex = request.getParameter("sex");
        String suer = request.getParameter("suer");
        String Education = request.getParameter("Education");
        PrintWriter out = response.getWriter();
        out.println("<html>");
        out.println("<head>");
        out.println("<title>注册提交结果</title>");
        out.println("</head>");
        out.println("<body>");
        out.println("<h1>注册提交结果</h1>");
        out.println("<table border=1 align=left>");
        out.println("<tr><th>参数</th><th>参数值></th></tr>");
        out.println("<tr><td>username</td><td>"+username+"</td></tr>");
        out.println("<tr><td>password</td><td>"+password+"</td></tr>");
        out.println("<tr><td>email</td><td>"+email+"</td></tr>");
        out.println("<tr><td>sex</td><td>"+sex+"</td></tr>");
        out.println("<tr><td>suer</td><td>"+suer+"</td></tr>");
        out.println("<tr><td>Education</td><td>"+Education+"</td></tr>");
        out.println("</table>");
        out.println("</body>");
        out.println("</html>");
        out.flush();
        out.close();
    }
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }
}
